<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./graphe.js"></script>
  <style>
    * {
      padding: 0;
      margin: 0;
    }
    
    body,
    html {
      /* width: 100%;
      height: 100%; */
      height: 100%;
      overflow: hidden;

    }
    #canavasContainer{
      height: 100%;
    }
    
    .tooltip{
      position: absolute;
      left: 0;
      border: 1px solid black;
      padding: 10px;
    }
  </style>
</head>

<body>
  <div id="canavasContainer">
    
  </div>
 
</body>
<script>
  
  let mock1 = {
    "points": [
      { "id": "121", "name": "121号", "meshIP": "192.168.1.121", "noise": 91, "defaultName": "#121" },
      { "id": "138", "name": "138号", "meshIP": "192.168.1.138", "noise": 91, "defaultName": "#138" },
      { "id": "139", "name": "139号", "meshIP": "192.168.1.139", "noise": 91, "defaultName": "#139" },
      { "id": "140", "name": "140号", "meshIP": "192.168.1.140", "noise": 91, "defaultName": "#140" },
      { "id": "141", "name": "141号", "meshIP": "192.168.1.141", "noise": 91, "defaultName": "#141" },
      
    ],
    "lines": [
      { "from": "121", "to": "138", "signal": 104, "needBold": 0 },
      { "from": "138", "to": "121", "signal": 160, "needBold": 0 },
      { "from": "138", "to": "139", "signal": 10, "needBold": 0 }
    ],
    
  }
  let mock = {
    "points": [
      { "id": "121", "name": "121号", "meshIP": "192.168.1.121", "noise": 91, "defaultName": "#121" },
      { "id": "138", "name": "138号", "meshIP": "192.168.1.138", "noise": 91, "defaultName": "#138" },
      { "id": "139", "name": "139号", "meshIP": "192.168.1.139", "noise": 91, "defaultName": "#139" },
      { "id": "140", "name": "140号", "meshIP": "192.168.1.140", "noise": 91, "defaultName": "#140" },
      { "id": "141", "name": "141号", "meshIP": "192.168.1.141", "noise": 91, "defaultName": "#141" },
      { "id": "142", "name": "142号", "meshIP": "192.168.1.142", "noise": 91, "defaultName": "#142" }
    ],
    "lines": [
      { "from": "121", "to": "138", "signal": 104, "needBold": 0 },
      { "from": "138", "to": "121", "signal": 160, "needBold": 0 },
      { "from": "138", "to": "139", "signal": 20, "needBold": 0 },
      { "from": "139", "to": "138", "signal": 30, "needBold": 0 }
    ],
  }
  let mock2= {
    "points": [
      { "id": "121", "name": "121号", "meshIP": "192.168.1.121", "noise": 91, "defaultName": "#121" },
      { "id": "138", "name": "138号", "meshIP": "192.168.1.138", "noise": 91, "defaultName": "#138" },
      { "id": "139", "name": "139号", "meshIP": "192.168.1.139", "noise": 91, "defaultName": "#139" },
      { "id": "140", "name": "140号", "meshIP": "192.168.1.140", "noise": 91, "defaultName": "#140" },
      { "id": "141", "name": "141号", "meshIP": "192.168.1.141", "noise": 91, "defaultName": "#141" },
      { "id": "142", "name": "142号", "meshIP": "192.168.1.142", "noise": 91, "defaultName": "#142" }
    ],
    "lines": [
      { "from": "121", "to": "138", "signal": 104, "needBold": 0 },
      { "from": "138", "to": "121", "signal": 160, "needBold": 0 },
      { "from": "138", "to": "139", "signal": 40, "needBold": 0 },
      { "from": "139", "to": "138", "signal": 50, "needBold": 0 }
    ],
  }
  let gra = new Graphe(document.getElementById('canavasContainer'));

  setTimeout(()=>{
    gra.update(mock1.points, mock1.lines)
  },500)
  setTimeout(()=>{
    gra.update(mock.points, mock.lines)
  },1000)
  setTimeout(()=>{
    gra.update(mock2.points, mock2.lines)
  },1500)
 
</script>

</html>